import http from "@/api";
import {
  QueryUserListParam,
  UserListResult,
  CreateUserParam,
  EditUserStatusParam,
  InitUserPasswordParam,
  EditUserInfoParam
} from "@/api/interface/auth/user";
import { ResPage } from "@/api/interface";

const apiName = "UserManager";

/** 查询用户列表 */
export const queryUserList = (param: QueryUserListParam) => {
  return http.post<ResPage<UserListResult>>(`${apiName}/QueryUserList`, param);
};

/** 新增用户 */
export const createUser = (param: CreateUserParam) => {
  return http.post<string>(`${apiName}/CreateUser`, param);
};

/** 修改用户信息 */
export const editUserInfo = (param: EditUserInfoParam) => {
  return http.post<string>(`${apiName}/EditUserInfo`, param);
};

/** 修改用户状态 */
export const editUserStatus = (param: EditUserStatusParam) => {
  return http.post<string>(`${apiName}/EditUserStatus`, param);
};

/** 重置账户密码 */
export const initUserPassword = (param: InitUserPasswordParam) => {
  return http.post<string>(`${apiName}/InitUserPassword`, param);
};
